<%@ page import="com.demo.servlet.demo1220.entity.Person" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %><%--
  Created by IntelliJ IDEA.
  User: WuLiangHang
  Date: 2021/12/20
  Time: 11:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Person p = new Person();
    p.setName("小明");
    p.setPhones(new String[]{"1", "2", "3", "4"});
    List<String> cities = new ArrayList<>();
    cities.add("北京");
    cities.add("上海");
    cities.add("广州");
    cities.add("深圳");
    p.setCities(cities);
    Map<String, Object> map = new HashMap<>();
    map.put("1", "value1");
    map.put("key2", "value2");
    map.put("key3", "value3");
    map.put("key4", "value4");
    p.setMap(map);
    pageContext.setAttribute("person", p);
%>
输出 Person ：${person} <br/>
输出 Person 的 name 属性：${person.name} <br/>
输出 Person 的 数组 phones[1] 属性：${person.phones[1]} <br/>
输出 Person 的 List cities 属性：${person.cities} <br/>
输出 Person 的 List cities第0个 属性：${person.cities[0]} <br/>
输出 Person 的 map 属性：${person.map} <br/>
输出 Person 的 map key = 1 属性：${person.map."1"} <br/>
输出 Person 的 map key = key2 属性：${person.map.key2} <br/>
</body>
</html>
